SPB Git forge

spb/websensor

Public
33commits 1branches 0releases
3.4 MBsize
maindefault branch
10 days agolast push
TypeScript 55.4% Python 43.2% SQL 1.2%
560 B · 14 lines tsx
Raw Blame History
1import { notFound } from "next/navigation";2import type { ReactNode } from "react";3import { api } from "@/lib/api";45/**6 * Existence check outside the `loading.tsx` boundary so unknown event slugs return a real 404 instead of a7 * 200 shell followed by the not-found UI (the page's own call is deduplicated by fetch memoization).8 */9export default async function EventLayout({ params, children }: { params: Promise<{ slug: string }>; children: ReactNode }) {10  const { slug } = await params;11  if (!(await api.event(slug))) notFound();12  return children;13}14